package com.filetransfer.viewmodel;
import com.filetransfer.view.Components.render.*;
import com.filetransfer.viewmodel.base.TaskTableModel;

import javax.swing.table.TableColumnModel;
public class UploadTableViewModel extends TaskTableModel {
    public static final String[] columnNames = {"上传任务名称", "状态", "进度", "分享码", "message"};
    public UploadTableViewModel() {
        super(columnNames);
    }
    @Override
    public void editColumnModel(TableColumnModel model) {
        super.editColumnModel(model);
        model.getColumn(2).setCellRenderer(new ProgressBarRenderer());
        model.getColumn(3).setCellRenderer(new ShareCodeRender());
        model.getColumn(3).setCellEditor(new ShareCodeEditor());
        model.getColumn(4).setCellRenderer(new MessageRenderer());
        model.getColumn(4).setCellEditor(new MessageEditor());
    }
    @Override
    public boolean isCellEditable(int row, int column) {
        return column == 3 || column == 4;
    }
}
